package com.example.feign;

import com.example.entity.TShopProduct;
import com.example.feign.fallback.ProductFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
/*
*   name属性：访问员端服务的名字
* fallback属性：当远端服务器失败时，本地的错误处理类
* */
@FeignClient(name = "product",fallback = ProductFeignFallback.class)
public interface ProductFeignApi {

    @RequestMapping("/product/get/{pid}")
    TShopProduct get(@PathVariable("pid") Long pid);
}
